#ifndef CONCURRENTALLOC_H
#define CONCURRENTALLOC_H

#include"ThreadCache.h"

static void* ConcurrentAlloc(size_t size)
{
	if (pTLSThreadCache == nullptr)
	{
		pTLSThreadCache = new ThreadCache;
	}
	std::cout << std::this_thread::get_id()<<": "<<pTLSThreadCache << std::endl;
	return pTLSThreadCache->Allocate(size);
}
static void ConcurrentFree(void* ptr,size_t size)
{
	if (ptr == nullptr) throw(ConcurrentAllocException("Functional ConcurrentFree: Free nullptr"));
	pTLSThreadCache->DeAllocate(ptr, size);
}

#endif  //!CONCURRENTALLOC_H
